package fr.vvins.core.catalog.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import fr.vvins.core.dao.EntityImpl;


/**
 * Variety entity
 */
@Entity
@Table(schema="vvins",name="VV_VARIETY")
public class Variety extends EntityImpl implements Serializable {

	
	private static final long serialVersionUID = 4470205630141255467L;
	
	@Id
	@GeneratedValue
	@Column(name="ID")
	private Integer id;
	
	@Basic
	@Column(name="NAME")
	private String name;
	
	@ManyToOne
	@JoinColumn(name="REGION_ID")
	private Region region;

	public Variety() {
	}

	public Variety(String name) {
		this.name = name;
	}

	@Override
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Region getRegion() {
		return region;
	}

	public void setRegion(Region region) {
		this.region = region;
	}

}
